3.1.53 \(\int \text {sech}(c+d x) (a+b \text {sech}^2(c+d x)) \, dx\) [53]

Optimal. Leaf size=40 \[ \frac {(2 a+b) \text {ArcTan}(\sinh (c+d x))}{2 d}+\frac {b \text {sech}(c+d x) \tanh (c+d x)}{2 d} \]

[Out]

1/2*(2*a+b)*arctan(sinh(d*x+c))/d+1/2*b*sech(d*x+c)*tanh(d*x+c)/d

________________________________________________________________________________________

Rubi [A]
time = 0.02, antiderivative size = 40, normalized size of antiderivative = 1.00, number of steps used = 2, number of rules used = 2, integrand size = 19, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.105, Rules used = {4131, 3855} \begin {gather*} \frac {(2 a+b) \text {ArcTan}(\sinh (c+d x))}{2 d}+\frac {b \tanh (c+d x) \text {sech}(c+d x)}{2 d} \end {gather*}

Antiderivative was successfully verified.

[In]

Int[Sech[c + d*x]*(a + b*Sech[c + d*x]^2),x]

[Out]

((2*a + b)*ArcTan[Sinh[c + d*x]])/(2*d) + (b*Sech[c + d*x]*Tanh[c + d*x])/(2*d)

Rule 3855

Int[csc[(c_.) + (d_.)*(x_)], x_Symbol] :> Simp[-ArcTanh[Cos[c + d*x]]/d, x] /; FreeQ[{c, d}, x]

Rule 4131

Int[(csc[(e_.) + (f_.)*(x_)]*(b_.))^(m_.)*(csc[(e_.) + (f_.)*(x_)]^2*(C_.) + (A_)), x_Symbol] :> Simp[(-C)*Cot
[e + f*x]*((b*Csc[e + f*x])^m/(f*(m + 1))), x] + Dist[(C*m + A*(m + 1))/(m + 1), Int[(b*Csc[e + f*x])^m, x], x
] /; FreeQ[{b, e, f, A, C, m}, x] && NeQ[C*m + A*(m + 1), 0] &&  !LeQ[m, -1]

Rubi steps

\begin {align*} \int \text {sech}(c+d x) \left (a+b \text {sech}^2(c+d x)\right ) \, dx &=\frac {b \text {sech}(c+d x) \tanh (c+d x)}{2 d}+\frac {1}{2} (2 a+b) \int \text {sech}(c+d x) \, dx\\ &=\frac {(2 a+b) \tan ^{-1}(\sinh (c+d x))}{2 d}+\frac {b \text {sech}(c+d x) \tanh (c+d x)}{2 d}\\ \end {align*}

________________________________________________________________________________________

Mathematica [A]
time = 0.02, size = 48, normalized size = 1.20 \begin {gather*} \frac {a \text {ArcTan}(\sinh (c+d x))}{d}+\frac {b \text {ArcTan}(\sinh (c+d x))}{2 d}+\frac {b \text {sech}(c+d x) \tanh (c+d x)}{2 d} \end {gather*}

Antiderivative was successfully verified.

[In]

Integrate[Sech[c + d*x]*(a + b*Sech[c + d*x]^2),x]

[Out]

(a*ArcTan[Sinh[c + d*x]])/d + (b*ArcTan[Sinh[c + d*x]])/(2*d) + (b*Sech[c + d*x]*Tanh[c + d*x])/(2*d)

________________________________________________________________________________________

Maple [C] Result contains complex when optimal does not.
time = 1.17, size = 105, normalized size = 2.62

method result size
risch \(\frac {b \,{\mathrm e}^{d x +c} \left ({\mathrm e}^{2 d x +2 c}-1\right )}{d \left (1+{\mathrm e}^{2 d x +2 c}\right )^{2}}+\frac {i \ln \left ({\mathrm e}^{d x +c}+i\right ) a}{d}+\frac {i b \ln \left ({\mathrm e}^{d x +c}+i\right )}{2 d}-\frac {i \ln \left ({\mathrm e}^{d x +c}-i\right ) a}{d}-\frac {i b \ln \left ({\mathrm e}^{d x +c}-i\right )}{2 d}\) \(105\)

Verification of antiderivative is not currently implemented for this CAS.

[In]

int(sech(d*x+c)*(a+b*sech(d*x+c)^2),x,method=_RETURNVERBOSE)

[Out]

b*exp(d*x+c)*(exp(2*d*x+2*c)-1)/d/(1+exp(2*d*x+2*c))^2+I/d*ln(exp(d*x+c)+I)*a+1/2*I*b/d*ln(exp(d*x+c)+I)-I/d*l
n(exp(d*x+c)-I)*a-1/2*I*b/d*ln(exp(d*x+c)-I)

________________________________________________________________________________________

Maxima [B] Leaf count of result is larger than twice the leaf count of optimal. 81 vs. \(2 (36) = 72\).
time = 0.48, size = 81, normalized size = 2.02 \begin {gather*} -b {\left (\frac {\arctan \left (e^{\left (-d x - c\right )}\right )}{d} - \frac {e^{\left (-d x - c\right )} - e^{\left (-3 \, d x - 3 \, c\right )}}{d {\left (2 \, e^{\left (-2 \, d x - 2 \, c\right )} + e^{\left (-4 \, d x - 4 \, c\right )} + 1\right )}}\right )} + \frac {a \arctan \left (\sinh \left (d x + c\right )\right )}{d} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(sech(d*x+c)*(a+b*sech(d*x+c)^2),x, algorithm="maxima")

[Out]

-b*(arctan(e^(-d*x - c))/d - (e^(-d*x - c) - e^(-3*d*x - 3*c))/(d*(2*e^(-2*d*x - 2*c) + e^(-4*d*x - 4*c) + 1))
) + a*arctan(sinh(d*x + c))/d

________________________________________________________________________________________

Fricas [B] Leaf count of result is larger than twice the leaf count of optimal. 321 vs. \(2 (36) = 72\).
time = 0.35, size = 321, normalized size = 8.02 \begin {gather*} \frac {b \cosh \left (d x + c\right )^{3} + 3 \, b \cosh \left (d x + c\right ) \sinh \left (d x + c\right )^{2} + b \sinh \left (d x + c\right )^{3} + {\left ({\left (2 \, a + b\right )} \cosh \left (d x + c\right )^{4} + 4 \, {\left (2 \, a + b\right )} \cosh \left (d x + c\right ) \sinh \left (d x + c\right )^{3} + {\left (2 \, a + b\right )} \sinh \left (d x + c\right )^{4} + 2 \, {\left (2 \, a + b\right )} \cosh \left (d x + c\right )^{2} + 2 \, {\left (3 \, {\left (2 \, a + b\right )} \cosh \left (d x + c\right )^{2} + 2 \, a + b\right )} \sinh \left (d x + c\right )^{2} + 4 \, {\left ({\left (2 \, a + b\right )} \cosh \left (d x + c\right )^{3} + {\left (2 \, a + b\right )} \cosh \left (d x + c\right )\right )} \sinh \left (d x + c\right ) + 2 \, a + b\right )} \arctan \left (\cosh \left (d x + c\right ) + \sinh \left (d x + c\right )\right ) - b \cosh \left (d x + c\right ) + {\left (3 \, b \cosh \left (d x + c\right )^{2} - b\right )} \sinh \left (d x + c\right )}{d \cosh \left (d x + c\right )^{4} + 4 \, d \cosh \left (d x + c\right ) \sinh \left (d x + c\right )^{3} + d \sinh \left (d x + c\right )^{4} + 2 \, d \cosh \left (d x + c\right )^{2} + 2 \, {\left (3 \, d \cosh \left (d x + c\right )^{2} + d\right )} \sinh \left (d x + c\right )^{2} + 4 \, {\left (d \cosh \left (d x + c\right )^{3} + d \cosh \left (d x + c\right )\right )} \sinh \left (d x + c\right ) + d} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(sech(d*x+c)*(a+b*sech(d*x+c)^2),x, algorithm="fricas")

[Out]

(b*cosh(d*x + c)^3 + 3*b*cosh(d*x + c)*sinh(d*x + c)^2 + b*sinh(d*x + c)^3 + ((2*a + b)*cosh(d*x + c)^4 + 4*(2
*a + b)*cosh(d*x + c)*sinh(d*x + c)^3 + (2*a + b)*sinh(d*x + c)^4 + 2*(2*a + b)*cosh(d*x + c)^2 + 2*(3*(2*a +
b)*cosh(d*x + c)^2 + 2*a + b)*sinh(d*x + c)^2 + 4*((2*a + b)*cosh(d*x + c)^3 + (2*a + b)*cosh(d*x + c))*sinh(d
*x + c) + 2*a + b)*arctan(cosh(d*x + c) + sinh(d*x + c)) - b*cosh(d*x + c) + (3*b*cosh(d*x + c)^2 - b)*sinh(d*
x + c))/(d*cosh(d*x + c)^4 + 4*d*cosh(d*x + c)*sinh(d*x + c)^3 + d*sinh(d*x + c)^4 + 2*d*cosh(d*x + c)^2 + 2*(
3*d*cosh(d*x + c)^2 + d)*sinh(d*x + c)^2 + 4*(d*cosh(d*x + c)^3 + d*cosh(d*x + c))*sinh(d*x + c) + d)

________________________________________________________________________________________

Sympy [F]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \int \left (a + b \operatorname {sech}^{2}{\left (c + d x \right )}\right ) \operatorname {sech}{\left (c + d x \right )}\, dx \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(sech(d*x+c)*(a+b*sech(d*x+c)**2),x)

[Out]

Integral((a + b*sech(c + d*x)**2)*sech(c + d*x), x)

________________________________________________________________________________________

Giac [B] Leaf count of result is larger than twice the leaf count of optimal. 84 vs. \(2 (36) = 72\).
time = 0.40, size = 84, normalized size = 2.10 \begin {gather*} \frac {{\left (\pi + 2 \, \arctan \left (\frac {1}{2} \, {\left (e^{\left (2 \, d x + 2 \, c\right )} - 1\right )} e^{\left (-d x - c\right )}\right )\right )} {\left (2 \, a + b\right )} + \frac {4 \, b {\left (e^{\left (d x + c\right )} - e^{\left (-d x - c\right )}\right )}}{{\left (e^{\left (d x + c\right )} - e^{\left (-d x - c\right )}\right )}^{2} + 4}}{4 \, d} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(sech(d*x+c)*(a+b*sech(d*x+c)^2),x, algorithm="giac")

[Out]

1/4*((pi + 2*arctan(1/2*(e^(2*d*x + 2*c) - 1)*e^(-d*x - c)))*(2*a + b) + 4*b*(e^(d*x + c) - e^(-d*x - c))/((e^
(d*x + c) - e^(-d*x - c))^2 + 4))/d

________________________________________________________________________________________

Mupad [B]
time = 0.16, size = 124, normalized size = 3.10 \begin {gather*} \frac {\mathrm {atan}\left (\frac {{\mathrm {e}}^{d\,x}\,{\mathrm {e}}^c\,\left (2\,a\,\sqrt {d^2}+b\,\sqrt {d^2}\right )}{d\,\sqrt {4\,a^2+4\,a\,b+b^2}}\right )\,\sqrt {4\,a^2+4\,a\,b+b^2}}{\sqrt {d^2}}+\frac {b\,{\mathrm {e}}^{c+d\,x}}{d\,\left ({\mathrm {e}}^{2\,c+2\,d\,x}+1\right )}-\frac {2\,b\,{\mathrm {e}}^{c+d\,x}}{d\,\left (2\,{\mathrm {e}}^{2\,c+2\,d\,x}+{\mathrm {e}}^{4\,c+4\,d\,x}+1\right )} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

int((a + b/cosh(c + d*x)^2)/cosh(c + d*x),x)

[Out]

(atan((exp(d*x)*exp(c)*(2*a*(d^2)^(1/2) + b*(d^2)^(1/2)))/(d*(4*a*b + 4*a^2 + b^2)^(1/2)))*(4*a*b + 4*a^2 + b^
2)^(1/2))/(d^2)^(1/2) + (b*exp(c + d*x))/(d*(exp(2*c + 2*d*x) + 1)) - (2*b*exp(c + d*x))/(d*(2*exp(2*c + 2*d*x
) + exp(4*c + 4*d*x) + 1))

________________________________________________________________________________________